from numpy import *


def img2vector(filename):
    vec = zeros((1, 1024))
    f = open(filename)
    for i in range(32):
        line = f.readline()
        for j in range(32):
            vec[0, 32 * i + j] = int(line[j])
    return vec

